<template>
  <div>
    <button @click="btn">点击</button>
  </div>
</template>

<script>
  import PubSub from 'pubsub-js'
  export default {
    name:'text4',
    methods:{
      btn(){
        //发布消息
       PubSub.publish('btndata','订阅与发布')
      }
    }
  }
</script>

<style scoped>

</style>
